package org.erepublik.company;

public class PriceIndex implements Comparable<PriceIndex> {

    private Location location;
    private double price;
    private double priceYesterday;
    private double priceWeekAgo;
    private int importTax;
    private int vat;
    private int population;
    
    public int getPopulation() {
        return population;
    }
    public void setPopulation(int population) {
        this.population = population;
    }
    public int getImportTax() {
        return importTax;
    }
    public void setImportTax(int importTax) {
        this.importTax = importTax;
    }
    public int getVat() {
        return vat;
    }
    public void setVat(int vat) {
        this.vat = vat;
    }



    
    
    public double getPrice() {
        return price;
    }
    public void setPrice(double price) {
        this.price = price;
    }
    public double getPriceYesterday() {
        return priceYesterday;
    }
    public void setPriceYesterday(double priceYesteday) {
        this.priceYesterday = priceYesteday;
    }
    public double getPriceWeekAgo() {
        return priceWeekAgo;
    }
    public void setPriceWeekAgo(double priceWeekAgo) {
        this.priceWeekAgo = priceWeekAgo;
    }
    public Location getLocation() {
        return location;
    }
    public void setLocation(Location location) {
        this.location = location;
    }
    
    
    @Override
    public int compareTo(PriceIndex o) {
        double comparator = price - o.getPrice();
        if (price==0.0)
            return 1;
        if (o.getPrice()==0.0)
            return -1;
        if (comparator < 0)
            return 1;
        if (comparator > 0)
            return -1;
        return 0;
    }
    
}
